﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace INSTA.MusiqueStore.DAL
{
    public partial class Piste
    {

        /// <summary>
        /// Gets the ASP track player.
        /// </summary>
        /// <value>The ASP track player.</value>
        public string AspTrackPlayer
        {
            get
            {
                string html =
                    "<object type=\"application/x-shockwave-flash\" data=\"player_mp3_maxi.swf\" width=\"26\" height=\"20\"  id = \"" + LienFichier + "\" onMouseDown=\"stop('" + LienFichier + "');\"><param name=\"movie\" value=\"player_mp3_maxi.swf\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"FlashVars\" value=\"mp3=mp3/" +
                    LienFichier + "&amp;width=26&amp;showslider=0&amp;bgcolor1=fa8700&amp;bgcolor2=fa8700\" /><param name=\"wmode\" value=\"transparent\" /></object>";

                return html;
            }
        }

        /// <summary>
        /// Gets the download image and link.
        /// </summary>
        /// <value>The download image and link.</value>
        public string DownloadImageAndLink
        {
            get
            {
                var html = "<form method=\"post\" action=\"Dl.aspx\"><input type=\"hidden\" name=\"i\" value=\"" + Id + "\"><input type=\"image\" src=\"dl.png\" /></form>";
                //"<a href=\"mp3/" + LienFichier + "\"><img src=\"dl.png\"/></a>";
                return html;
            }

        }

        /// <summary>
        /// Gets the download image and link.
        /// </summary>
        /// <value>The download image and link.</value>
        public string AchatImageAndLink
        {
            get
            {
                var html = "<form method=\"post\" action=\"AchatPiste.aspx\"><input type=\"hidden\" name=\"i\" value=\"" + Id + "\"><input type=\"image\" src=\"achat.png\" /></form>";
                //"<a href=\"mp3/" + LienFichier + "\"><img src=\"dl.png\"/></a>";
                return html;
            }

        }

        public string AffichageAchat { get; set; }

        /// <summary>
        /// Gets the displayable duration.
        /// </summary>
        /// <value>The displayable duration.</value>
        public string DuréeAffichable
        {
            get { return Library.Tips.ToDisplayableTime(Durée); }
        }

        public string FormattedPrice
        {
            get
            {
                return Prix.ToString("c2");
            }

        }
    }
}
